<template>
  <view>
    <view>
      <button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">微信登录</button>
    </view>
  </view>
</template>

<script>
  export default {
    name: 'login',
    data() {
      return {

      }
    },
    methods: {
      getUserInfo(e) {
        const userInfo = e.detail.rawData;
        uni.setStorage({
          key: 'userInfo',
          data: userInfo,
          success: function () {
            uni.navigateTo({//存储好后跳转页面
              delta: 1
            })
          }
        })
      }
    }
  }
</script>

<style>
</style>